<!-- JQUERY UI-->
<script src="<?php echo base_url(); ?>skin/admin/js/jquery-ui-1.10.3.custom/js/jquery-ui-1.10.3.custom.min.js"></script>
<!-- BOOTSTRAP -->
<script src="<?php echo base_url(); ?>skin/admin/bootstrap-dist/js/bootstrap.min.js"></script>
<!-- UNIFORM -->
<script type="text/javascript" src="<?php echo base_url(); ?>skin/admin/js/uniform/jquery.uniform.min.js"></script>
<!-- DATE RANGE PICKER -->
<script src="<?php echo base_url(); ?>skin/admin/js/bootstrap-daterangepicker/moment.min.js"></script>
<!-- CUSTOM SCRIPT -->
<script src="<?php echo base_url(); ?>skin/admin/js/bootstrap-daterangepicker/daterangepicker.min.js"></script>
<!-- SLIMSCROLL -->
<script type="text/javascript" src="<?php echo base_url(); ?>skin/admin/js/jQuery-slimScroll-1.3.0/jquery.slimscroll.min.js"></script>
<script type="text/javascript" src="<?php echo base_url(); ?>skin/admin/js/jQuery-slimScroll-1.3.0/slimScrollHorizontal.min.js"></script>
<!-- COOKIE -->
<script type="text/javascript" src="<?php echo base_url(); ?>skin/admin/js/jQuery-Cookie/jquery.cookie.min.js"></script>
<script src="<?php echo base_url(); ?>skin/admin/js/script.js"></script>
<script>
    jQuery(document).ready(function() {
        App.setPage("login");  //Set current page
        App.init(); //Initialise plugins and elements
    });
</script>
<script type="text/javascript">
    function swapScreen(id) {
        jQuery('.visible').removeClass('visible animated fadeInUp');
        jQuery('#'+id).addClass('visible animated fadeInUp');
    }
</script>
<!-- /JAVASCRIPTS -->
<script type="text/javascript">
    function openKCFinder(field) {
        window.KCFinder = {
            callBack: function(url) {
                field.value = url;
                window.KCFinder = null;
            }
        };
        window.open('<?php echo base_url();?>ckeditor/up_file/browse.php?type=files&dir=files/public', 'kcfinder_textbox',
            'status=0, toolbar=0, location=0, menubar=0, directories=0, ' +
            'resizable=1, scrollbars=0, width=800, height=600'
        );
    }
</script>
<!--end fck-->
<!--ckfinder upload-->
<script type="text/javascript">
        function BrowseServer()                        {
            var finder = new CKFinder();
            finder.basePath = '../';    // The path for the installation of CKFinder (default = "/ckfinder/").
            finder.selectActionFunction = SetFileField;
            finder.popup();
            // It can also be done in a single line, calling the "static"
            // popup( basePath, width, height, selectFunction ) function:
            // CKFinder.popup( '../', null, null, SetFileField ) ;
            //
            // The "popup" function can also accept an object as the only argument.
            // CKFinder.popup( { basePath : '../', selectActionFunction : SetFileField } ) ;
        }

        // This is a sample function which is called when a file is selected in CKFinder.
        function SetFileField( fileUrl )
        {
            document.getElementById( 'xFilePath' ).value = fileUrl;
        }
</script>
<!--ckfinder-->
<!-- Random background color -->
<script>
$(document).ready(function() {
    var colors = ["#385c78","#9d302f","#5e87b0","#AE65FD","#494949"],
    selectedColor = colors[Math.floor(Math.random()*colors.length)]
    $("#header").css("background-color", selectedColor);
    $(".navbar #header-message .dropdown-toggle i").css("color", selectedColor);
});
</script>
<!-- End Random background color -->
<!-- Script Chèn Alias -->
<script type='text/javascript'>
	function locdau() {
	var str = (
    document.getElementById("title").value);
    str= str.toLowerCase();// chuyển chuỗi sang chữ thường để xử lý

	/* tìm kiếm và thay thế tất cả các nguyên âm có dấu sang không dấu*/

	str= str.replace(/à|á|ạ|ả|ã|â|ầ|ấ|ậ|ẩ|ẫ|ă|ằ|ắ|ặ|ẳ|ẵ/g,"a");

	str= str.replace(/è|é|ẹ|ẻ|ẽ|ê|ề|ế|ệ|ể|ễ/g,"e");

	str= str.replace(/ì|í|ị|ỉ|ĩ/g,"i");

	str= str.replace(/ò|ó|ọ|ỏ|õ|ô|ồ|ố|ộ|ổ|ỗ|ơ|ờ|ớ|ợ|ở|ỡ/g,"o");

	str= str.replace(/ù|ú|ụ|ủ|ũ|ư|ừ|ứ|ự|ử|ữ/g,"u");

	str= str.replace(/ỳ|ý|ỵ|ỷ|ỹ/g,"y");

	str= str.replace(/đ/g,"d");

	str= str.replace(/!|@|%|\^|\*|\(|\)|\+|\=|\<|\>|\?|\/|,|\.|\:|\;|\'| |\"|\&|\#|\[|\]|~|$|_/g,"-");
    str= str.replace(/“|”/g,"")	/* tìm và thay thế các kí tự đặc biệt trong chuỗi sang kí tự - */

	str= str.replace(/-+-/g,"-"); //thay thế 2- thành 1-

	str= str.replace(/^\-+|\-+$/g,"");//cắt bỏ ký tự - ở đầu và cuối chuỗi
	
	str = str; // Chuỗi Alias
	
	document.getElementById("alias").value = str;// xuất kết quả xữ lý ra keyword
	}
</script>
<!-- End -->
<!-- CKEDITTOR -->
<script type="text/javascript">
   if ( typeof CKEDITOR == 'undefined' ){
    	document.write("khong") ;
    }
    else{
    	var editor = CKEDITOR.replace( 'soanthao' );             
        CKFinder.setupCKEditor( editor, '<?php echo base_url();?>ckeditor/ckfinder/' ) ;  
        CKFinder.setupCKEditor( editor2, '<?php echo base_url();?>ckeditor/ckfinder/' ) ;                  	
    }
</script>
  </body>